#!/usr/bin/awk -f
BEGIN{
    max=0;
    min=1000;
    count=1;
    OFS = "\t";
}
{
    if ( NR == 1 )
    {
        print "name\t" $0 "\tmax"
        next;
    }
}
{
    column = NF
    for (i=2;i<=NF;i++)
    { 
        if($(column + 1) < $i)
        {
            $(column+ 1) = $i
        }
        if (highscore[i] < $i)
        {
            highscore[i] = $i
        }
    } 
}
{
    #print $0;
    for (i=1; i<=column + 1;i++)
    {
        if (i == (column + 1))
        {
            printf("|  %d", $(column +1))
            printf("\n");
        }
        else if (i == column)
        {
            printf("%s   ", $i)
        }
        else
        {
            printf("%s\t", $i)
        }
    }
    if (max<$(column + 1))
    {
        max= $(column + 1)
    }
}
END {
    printf("--------------------------------------------------\n");
    printf("score");
    #for (e in highscore)
    for(i = 2; i <= length(highscore); i++)
    {
        printf("\t"highscore[i]);
    }
    printf("\n--------------------------------------------------\n");
    print "highest score is:" max}
    #awk -F '[:| ]' '{print $1, $2, $3, $4, $5}' temp.txt
